package com.example.user.web;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

// MQ 消费方
@Component
public class MQConsume {

    @RabbitListener(queuesToDeclare = @Queue("simpleQueue"))
    public void handleMessage(String message){
        System.out.println("处理消息-1: " + message);
    }

    @RabbitListener(queuesToDeclare = @Queue("simpleQueue"))
    public void handleMessage1(String message){
        System.out.println("处理消息-2: " + message);
    }

    @RabbitListener(queuesToDeclare = @Queue("simpleQueue"))
    public void handleMessage2(String message){
        System.out.println("处理消息-3: " + message);
    }

}
